package a.f.d.a;

import a.a.db;
import a.a.m;
import a.c.e;
import a.c.k;
import a.c.n;
import a.c.q;
import a.c.v;
import a.c.w;
import a.c.x;
import a.f.d.pb;
import a.f.o;
import a.i.z;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class xc
  implements zb
{
  private zb a = new hc(new pb());
  private yb b = new s();
  public static int c;
  
  void a(Map paramMap)
  {
    Object localObject = paramMap.get("IncrementalLayerer.separateComponentsLayerer");
    if (!d.R)
    {
      if ((localObject instanceof zb)) {
        a((zb)localObject);
      }
      localObject = paramMap.get("IncrementalLayerer.layeredComponentsMerger");
    }
    if ((localObject instanceof yb)) {
      a((yb)localObject);
    }
  }
  
  public void a(o paramo, ac paramac, bc parambc)
  {
    boolean bool2 = d.R;
    boolean bool1 = d.Q;
    k localk = paramo.c(d.K);
    if (localk == null) {
      return;
    }
    ArrayList localArrayList = new ArrayList(64);
    Object localObject1 = paramo.v();
    do
    {
      if (!((w)localObject1).e()) {
        break;
      }
      localObject2 = ((w)localObject1).d();
      if (!bool2)
      {
        if (localk.getBool(localObject2)) {
          localArrayList.add(localObject2);
        }
        ((w)localObject1).f();
      }
    } while (!bool1);
    localObject1 = new q();
    Object localObject2 = paramo.B();
    int i = m.a(paramo, (x)localObject2);
    int[] arrayOfInt = new int[i];
    int j = 0;
    do
    {
      do
      {
        if (j >= arrayOfInt.length) {
          break;
        }
        arrayOfInt[j] = j;
        j++;
      } while (!bool1);
    } while (bool2);
    e[] arrayOfe1 = new e[paramo.j()];
    n localn1 = ((q)localObject1).C();
    n localn2 = ((q)localObject1).C();
    x localx1 = ((q)localObject1).B();
    x localx2 = ((q)localObject1).B();
    e[] arrayOfe2 = new e[paramac.a()];
    int k = paramac.a() + localArrayList.size() + 2;
    if (!bool2) {}
    int m = paramac.a() > 0 ? ((x)localObject2).getInt(paramac.a(0).c().m()) : -1;
    int n = k;
    int i1 = 0;
    if (i1 < arrayOfe2.length) {}
    Object localObject6;
    label448:
    label450:
    while (bool2)
    {
      localObject4 = ((q)localObject1).i();
      arrayOfe2[i1] = localObject4;
      int i3 = 0;
      localObject6 = paramac.a(i1).c().f();
      Object localObject8;
      do
      {
        if (localObject6 == null) {
          break;
        }
        localObject8 = (e)((v)localObject6).c();
        i3 += ((e)localObject8).d();
        arrayOfe1[localObject8.f()] = localObject4;
        arrayOfInt[localObject2.getInt(localObject8)] = m;
        localObject6 = ((v)localObject6).a();
        if (bool2) {
          break label450;
        }
        if (bool1) {
          break label448;
        }
      } while (!bool1);
      if (!bool2)
      {
        if (i1 > 0)
        {
          localObject6 = arrayOfe2[(i1 - 1)];
          localObject8 = ((q)localObject1).a((e)localObject6, (e)localObject4);
          localn2.a(localObject8, 1);
          localn1.a(localObject8, i3);
          n = Math.max(n, i3);
        }
        i1++;
      }
      if (!bool1) {
        break;
      }
    }
    Object localObject3 = paramo.v();
    do
    {
      if (!((w)localObject3).e()) {
        break;
      }
      localObject4 = ((w)localObject3).d();
      if (!bool2)
      {
        if (arrayOfInt[localObject2.getInt(localObject4)] == m) {
          ((x)localObject2).a(localObject4, m);
        }
        ((w)localObject3).f();
      }
    } while (!bool1);
    localObject3 = new ArrayList(localArrayList.size() + 32);
    Object localObject4 = localArrayList.iterator();
    label558:
    a.c.d locald1;
    label768:
    label780:
    do
    {
      break label780;
      if (!((Iterator)localObject4).hasNext()) {
        break;
      }
      int i6;
      e locale3;
      e locale4;
      a.c.d locald2;
      a.c.d locald3;
      do
      {
        localObject5 = (e)((Iterator)localObject4).next();
        do
        {
          if (((x)localObject2).getInt(localObject5) != m) {
            break;
          }
          localObject6 = ((q)localObject1).i();
          arrayOfe1[localObject5.f()] = localObject6;
        } while (bool2);
        if (bool1) {
          break label924;
        }
        i6 = 0;
        locald1 = ((e)localObject5).i();
        do
        {
          if (locald1 == null) {
            break label768;
          }
          if (bool1) {
            break;
          }
          if (!locald1.g())
          {
            i6++;
            locale3 = locald1.e();
            locale4 = arrayOfe1[locale3.f()];
            if (bool2) {
              continue;
            }
            if (locale4 != null)
            {
              locald2 = locale4.a((e)localObject6);
              if ((bool2) || (locald2 == null))
              {
                locald3 = ((q)localObject1).a(locale4, (e)localObject6);
                ((List)localObject3).add(locald3);
                localn1.a(locald3, 1);
                if (bool2) {
                  continue;
                }
                if (!bool1) {}
              }
              else
              {
                localn1.a(locald2, localn1.getInt(locald2) + 1);
              }
            }
          }
          locald1 = locald1.j();
        } while (!bool1);
        if (bool2) {
          break label558;
        }
        locald1 = ((e)localObject5).h();
        if (locald1 == null) {
          break;
        }
      } while (bool1);
      if (!locald1.g())
      {
        i6++;
        locale3 = locald1.f();
        locale4 = arrayOfe1[locale3.f()];
        if (bool2) {
          continue;
        }
        if (locale4 != null)
        {
          locald2 = ((e)localObject6).a(locale4);
          if ((bool2) || (locald2 == null))
          {
            locald3 = ((q)localObject1).a((e)localObject6, locale4);
            ((List)localObject3).add(locald3);
            localn1.a(locald3, 1);
            if (bool2) {
              continue;
            }
            if (!bool1) {}
          }
          else
          {
            localn1.a(locald2, localn1.getInt(locald2) + 1);
          }
        }
      }
      locald1 = locald1.i();
    } while (!bool1);
    label924:
    int i2 = 0;
    e locale1;
    do
    {
      do
      {
        if (i2 >= ((List)localObject3).size()) {
          break;
        }
        localObject5 = (a.c.d)((List)localObject3).get(i2);
        i5 = localn1.getInt(localObject5) * n;
        locale1 = ((q)localObject1).i();
        localx2.a(locale1, true);
        locald1 = ((q)localObject1).a(locale1, ((a.c.d)localObject5).f());
        localn2.a(locald1, 1);
        localn1.a(locald1, i5);
        localn1.a(localObject5, k * i5);
        if (bool2) {
          break label1087;
        }
        ((q)localObject1).a((a.c.d)localObject5, locale1, ((a.c.d)localObject5).e());
        i2++;
        if (bool1) {
          break label1085;
        }
      } while (!bool1);
      db.a((q)localObject1, localx1, localn1, localn2);
    } while (bool2);
    i2 = 2147483647;
    label1085:
    label1087:
    Object localObject5 = ((q)localObject1).v();
    do
    {
      while (!bool1)
      {
        if (!((w)localObject5).e()) {
          break;
        }
        if (bool1) {
          break label1163;
        }
        if (!localx2.getBool(((w)localObject5).d())) {
          i2 = Math.min(i2, localx1.getInt(((w)localObject5).d()));
        }
        ((w)localObject5).f();
      }
    } while (bool2);
    label1163:
    int i4 = 0;
    int i5 = 0;
    do
    {
      if (i5 >= arrayOfe2.length) {
        break;
      }
      locale1 = arrayOfe2[i5];
      int i8 = localx1.getInt(locale1) - i2;
      if (i8 > i4)
      {
        paramac.a((byte)0, i4);
        i4++;
      }
      for (;;)
      {
        if (!bool2) {
          if (!bool1)
          {
            if (!bool1) {
              break;
            }
            i5++;
            if (bool2) {
              continue;
            }
            i4++;
          }
        }
      }
    } while (!bool1);
    Object localObject7 = localArrayList.iterator();
    label1380:
    label1382:
    do
    {
      do
      {
        do
        {
          do
          {
            if (!((Iterator)localObject7).hasNext()) {
              break;
            }
            locale1 = (e)((Iterator)localObject7).next();
          } while (((x)localObject2).getInt(locale1) != m);
          e locale2 = arrayOfe1[locale1.f()];
          if (locale2 == null) {
            break;
          }
          int i10 = localx1.getInt(locale2) - i2;
          do
          {
            if (i10 < paramac.a()) {
              break;
            }
            paramac.a((byte)0, paramac.a());
            if (bool2) {
              break label1382;
            }
            if (bool1) {
              break label1380;
            }
          } while (!bool1);
          if (bool2) {
            break label1422;
          }
          paramac.a(i10).a(locale1);
        } while ((!bool2) && (!bool1));
        if (!bool2)
        {
          if (paramac.a() == 0) {
            paramac.a((byte)0, 0);
          }
          paramac.a(0).a(locale1);
        }
      } while (bool2);
    } while (!bool1);
    label1422:
    localObject7 = new z(paramo, (k)localObject2);
    int i7 = 0;
    do
    {
      if (i7 >= arrayOfInt.length) {
        break;
      }
      int i9 = arrayOfInt[i7];
      if ((!bool2) && (bool1)) {
        return;
      }
      if (!bool2)
      {
        if (i9 != m)
        {
          ((z)localObject7).c(new Integer(i9));
          ac localac = paramac.b();
          this.a.a(paramo, localac, parambc);
          this.b.a(paramo, parambc, localac, paramac);
        }
        i7++;
      }
    } while (!bool1);
    ((z)localObject7).g();
    if (!bool2) {
      paramo.a((x)localObject2);
    }
  }
  
  public zb a()
  {
    return this.a;
  }
  
  public void a(zb paramzb)
  {
    if (paramzb == null) {
      throw new NullPointerException();
    }
    this.a = paramzb;
  }
  
  public yb b()
  {
    return this.b;
  }
  
  public void a(yb paramyb)
  {
    if (paramyb == null) {
      throw new NullPointerException();
    }
    this.b = paramyb;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.d.a.xc

 * JD-Core Version:    0.7.0.1

 */